package com.atguigu.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;


import java.util.Arrays;
import java.util.List;

/**
 * @author wky
 * @create 2021-07-13-14:59
 */
public class FromCollection {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment senv = StreamExecutionEnvironment.getExecutionEnvironment();
        senv.setParallelism(1);
        List<String> list = Arrays.asList("1", "2", "3", "4");
        DataStreamSource<String> source = senv.fromCollection(list);
        source.print();
        senv.execute();


    }
}
